package com.sniff.atp;

import com.ckbs.global.common.GlobalCommonConfiguration;
import com.sniff.atp.constant.config.DBConnection;
import com.sniff.atp.utils.SslUtils;
import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.scheduling.annotation.EnableAsync;

import javax.annotation.PostConstruct;

@SpringBootApplication(scanBasePackages = {"com.ckbs","com.sniff.atp"},exclude= {GlobalCommonConfiguration.class, DataSourceAutoConfiguration.class})
@EnableAsync
@MapperScan({"com.sniff.**.mapper"})
@ComponentScan(basePackages = {"com.sniff.atp"})
@Slf4j
@EnableFeignClients(basePackages = {"com.ckbs"})
@EnableDiscoveryClient
@ServletComponentScan
public class ATPApplication {

    public ATPApplication(DBConnection dbConnection) {
        dbConnection.initDBConnection();
    }

    public static void main(String[] args) {
        SpringApplication.run(ATPApplication.class, args);
    }

    //忽略HTTPS请求的SSL证书
//    @PostConstruct
//    public void run() throws Exception{
//        SslUtils.ignoreSsl();
//    }
}
